<!doctype html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="description" content="速用视频中心">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>suyong</title>
<link rel="stylesheet" href="/js/movie/css/bootstrap.min.css">
<link rel="stylesheet" href="/js/movie/css/flexslider.css">
<link rel="stylesheet" href="/js/movie/css/jquery.fancybox.css">
<link rel="stylesheet" href="/js/movie/css/main.css">
<link rel="stylesheet" href="/js/movie/css/responsive.css">
<link rel="stylesheet" href="/js/movie/css/animate.min.css">
<link rel="stylesheet" href="/js/movie/css/font-icon.css">
<link rel="stylesheet" href="/js/movie/css/font-awesome.min.css">
</head>

<body>
<!-- header section -->
<section class="banner" role="banner">
<!--header navigation -->
  <header id="header">
    <div class="header-content clearfix"> <a class="logo" href="index.html"><img src="/js/movie/images/logo.png" alt=""></a>
      <nav class="navigation" role="navigation">
        <ul class="primary-nav">
          <li><a href="javascript:simple()">视频</a></li>
          <li><a href="javascript:custom()">音频</a></li>
		  <li><a href="#">返回</a></li>
        </ul>
      </nav>
      <a href="#" class="nav-toggle">Menu<span></span></a> </div>
      </header>
  </section>
<section id="banner" class="banner no-padding">
  <div class="container-fluid">
    <div class="row no-gutter">
      <div class="flexslider">
        <ul class="slides">
          <li>
            <div class="col-md-12">
              <blockquote>
                <p>为了无法计算的价值</p>
              </blockquote>
            </div>
          </li>
          <li>
            <div class="col-md-12">
              <blockquote>
                <h1>速用视频中心</h1>
                <p>为了无法计算的价值</p>
              </blockquote>
            </div>
          </li>
        </ul>
      </div>
     </div>
  </div>
</section>
<div id="qrcode"></div>
<!-- portfolio section --> 
  <!-- footer -->
<footer class="section footer">
  <div class="footer-bottom">
    <div class="container">
      <div class="col-md-12">
        <p>
        <ul class="footer-share">
        </ul>
        </p>
        <p>© 2018 All rights reserved. All Rights Reserved<br>

      </div>
    </div>
  </div>
</footer>
<!-- footer --> 
<!-- JS FILES --> 
<script src="/js/jquery.min.js"></script> 
<script src="/js/movie/js/bootstrap.min.js"></script> 
<script src="/js/appjs/loa/jquery.qrcode.min.js"></script> 
<script src="/js/movie/js/jquery.flexslider-min.js"></script> 
<script src="/js/movie/js/jquery.fancybox.pack.js"></script> 
<script src="/js/movie/js/jquery.waypoints.min.js"></script> 
<script src="/js/movie/js/retina.min.js"></script> 
<script src="/js/movie/js/modernizr.js"></script> 
<script src="/js/movie/js/main.js"></script>
<script th:inline="javascript">
   var code = [[${code}]];
   alert(code);
	function clear() {
		$('#qrcode').empty();
	}
	/* 最简单方式	 */
	function simple() {
		clear();
		jQuery('#qrcode').qrcode(code);
	}

	function custom() {
		clear();
		jQuery('#qrcode').qrcode({
			render : "canvas",
			width : 200,
			height : 200,
			correctLevel : 0,
			text : code
		});
	}
	/*在chorme浏览器中二维码生成成功后无法扫描解决方法：  */
	function chorme() {
		clear();
		//改成使用table的渲染方式，亲测支持各种各版本的浏览器  
		jQuery('#qrcode').qrcode({
			width : 200,
			height : 200,
			correctLevel : 0,
			render : "table",
			text : "code"
		});
	}

	function Chinese() {
		clear();

		jQuery('#qrcode').qrcode({
			width : 200,
			height : 200,
			correctLevel : 0,
			render : "canvas",
			text : utf16to8("jquery-qrcode居然不支持中文，太可恨了！")
		});
	}

	function logo() {
		clear();
		alert("code");
		console.info("Javen测试");
	}

	function utf16to8(str) {
		var out, i, len, c;
		out = "";
		len = str.length;
		for (i = 0; i < len; i++) {
			c = str.charCodeAt(i);
			if ((c >= 0x0001) && (c <= 0x007F)) {
				out += str.charAt(i);
			} else if (c > 0x07FF) {
				out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
				out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
				out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
			} else {
				out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
				out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
			}
		}
		return out;
	}
</script>
</body>
</html>

